package com.thunder.soft.vm;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.MutableLiveData;

import com.thunder.soft.common.base.BaseViewModel;
import com.thunder.soft.ui.fragment.ProjectFragment;
import com.thunder.soft.ui.fragment.HomeFragment;
import com.thunder.soft.ui.fragment.PersonFragment;
import com.thunder.soft.ui.fragment.SystemFragment;

import java.util.ArrayList;
import java.util.List;

public class MainViewModel extends BaseViewModel {

    private MutableLiveData<List<Fragment>> fragmentLiveData = new MutableLiveData<>();

    @Override
    public void onCreate(@NonNull LifecycleOwner owner) {
        super.onCreate(owner);

        List<Fragment> fragments = new ArrayList<>();

        HomeFragment homeFragment = new HomeFragment();
        fragments.add(homeFragment);
        ProjectFragment projectFragment = new ProjectFragment();
        fragments.add(projectFragment);
        SystemFragment systemFragment = new SystemFragment();
        fragments.add(systemFragment);
        PersonFragment personFragment = new PersonFragment();
        fragments.add(personFragment);

        fragmentLiveData.postValue(fragments);
    }

    public MutableLiveData<List<Fragment>> getFragmentLiveData(){
        return fragmentLiveData;
    }
}